package com.fooddelivery.Entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单和菜品关联表
 * </p>
 *
 * @author swy
 * @since 2025-09-12
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("order_dish")
@ApiModel(value = "OrderDish对象", description = "订单和菜品关联表")
public class OrderDish implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("关联关系ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("订单ID")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty("菜品ID")
    @TableField("dish_id")
    private Long dishId;

    @ApiModelProperty("菜品数量")
    @TableField("quantity")
    private Integer quantity;

    @ApiModelProperty("下单时菜品单价")
    @TableField("snapshot_price")
    private BigDecimal snapshotPrice;
}
